#include<stdio.h>


int year(int x)
{
    if(((x%4==0)&&(x%100!=0))||(x%400==0))
    {
        return 1;
    }
    else
    {
        return 0;
    }
}


int main()
{
    int n;
    scanf("%d",&n);
    printf("%d",year(n));
    return 0;
}